<link href="style.css" rel="stylesheet" type="text/css">
<%if (task.getMasterTable().equals("company_master")) {%>
	<table width="100%" border="0" align="center" cellspacing="1" class="style2">
		<tr>
		  <td align="right">Table</td>
		  <td>&nbsp;</td>
		  <td align="" class="style1">COMPANY_MASTER</td>
		  <td>&nbsp;</td>
	  </tr>
		<tr>
			<td width="98" align="right">ID</td>
			<td width="10">&nbsp;</td>
			<td class="style1"><label id="id"><%=rc.getInt("id")%></label></td>
			<td width="10">&nbsp;</td>
		</tr>
          <tr>
            <td align="right">Short Name </td>
            <td>&nbsp;</td>
            <td><input name="name" type="text" id="name" style="width:100%" value="<%=rc.getString("name")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Full Name </td>
            <td>&nbsp;</td>
            <td><input name="full_name" type="text" id="full_name" style="width:100%" value="<%=rc.getString("full_name")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Addess </td>
            <td>&nbsp;</td>
            <td><input name="address1" type="text" id="address1" style="width:100%" value="<%=rc.getString("address1")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">&nbsp;</td>
            <td>&nbsp;</td>
            <td><input name="address2" type="text" id="address2" style="width:100%" value="<%=rc.getString("address2")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">E-Mail</td>
            <td>&nbsp;</td>
            <td><input name="email" type="text" id="email" style="width:100%" value="<%=rc.getString("email")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Telephone</td>
            <td>&nbsp;</td>
            <td><input name="telephone" type="text" id="telephone" style="width:100%" value="<%=rc.getString("telephone")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Fax</td>
            <td>&nbsp;</td>
            <td><input name="fax" type="text" id="fax" style="width:100%" value="<%=rc.getString("fax")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Country</td>
            <td>&nbsp;</td>
            <td>
			<select name="country_id" id="country_id"  style="width:100%">
				<option value="0"></option>
				<%task.getResponse().setOption(task.getMasterList("country_master"));%>
				<%task.getResponse().setSelected("country_id",rc.getIntValue("country_id"));%>
            </select>			</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Type</td>
            <td>&nbsp;</td>
            <td>
				<table width="100%"  border="0" bgcolor="#EEEEEE" class="style2">
                  <tr>
                    <td width="25%"><input name="buyer_"    id="buyer_"    type="checkbox" value="1" onClick="cbxClick(this)">Buyer</td>					
                    <td width="25%"><input name="agent_"    id="agent_"    type="checkbox" value="1" onClick="cbxClick(this)">Agent</td>
                    <td width="25%"><input name="broker_"   id="broker_"   type="checkbox" value="1" onClick="cbxClick(this)">Broker</td>
                    <td width="25%"><input name="supplier_" id="supplier_" type="checkbox" value="1" onClick="cbxClick(this)">Supplier</td>
                    <td width="25%"><input name="service_"  id="service_"  type="checkbox" value="1" onClick="cbxClick(this)">Service</td>
                  </tr>
                  <tr>
                    <td><input name="seller_"     id="seller_"     type="checkbox" value="1" onClick="cbxClick(this)">Seller</td>
                    <td><input name="client_"     id="client_"     type="checkbox" value="1" onClick="cbxClick(this)">Client</td>
                    <td><input name="shipper_"    id="shipper_"    type="checkbox" value="1" onClick="cbxClick(this)">Shipper</td>
                    <td><input name="controller_" id="controller_" type="checkbox" value="1" onClick="cbxClick(this)">Controller</td>
                    <td>&nbsp;</td>
                  </tr>
                </table>
			</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Active</td>
            <td>&nbsp;</td>
            <td><input name="active_" id="active_" type="checkbox" value="1" onClick="cbxClick(this)"></td>
            <td>&nbsp;</td>
          </tr>
</table>
<input type="hidden" name="buyer"      id="buyer"      value="0">
<input type="hidden" name="agent"      id="agent"      value="0">
<input type="hidden" name="broker"     id="broker"     value="0">
<input type="hidden" name="seller"     id="seller"     value="0">
<input type="hidden" name="client"     id="client"     value="0">
<input type="hidden" name="shipper"    id="shipper"    value="0">
<input type="hidden" name="supplier"   id="supplier"   value="0">
<input type="hidden" name="controller" id="controller" value="0">
<input type="hidden" name="service"    id="service"    value="0">

<script language="javascript">

setCbx(getObj("buyer_"),     <%=rc.getIntValue("buyer")%>);
setCbx(getObj("agent_"),     <%=rc.getIntValue("agent")%>);
setCbx(getObj("broker_"),    <%=rc.getIntValue("broker")%>);
setCbx(getObj("seller_"),    <%=rc.getIntValue("seller")%>);
setCbx(getObj("client_"),    <%=rc.getIntValue("client")%>);
setCbx(getObj("shipper_"),   <%=rc.getIntValue("shipper")%>);
setCbx(getObj("supplier_"),  <%=rc.getIntValue("supplier")%>);
setCbx(getObj("controller_"),<%=rc.getIntValue("controller")%>);
setCbx(getObj("service_"),   <%=rc.getIntValue("service")%>);
	
function setFieldFocus(value)
{
	setValue("name",value);
	setValue("full_name",value);
	setFocus("name");
}

</script>
<%}%>
<%if (task.getMasterTable().equals("arbitration_master")) {%>
	<table width="100%" border="0" class="style2">
		<tr>
		  <td align="right">Table</td>
		  <td>&nbsp;</td>
		  <td align="" class="style1">ARBITRATION_MASTER</td>
		  <td>&nbsp;</td>
	  </tr>
		<tr>
			<td width="98" align="right">ID</td>
			<td width="10">&nbsp;</td>
		  <td class="style1"><label id="id"><%=rc.getInt("id")%></label></td>
			<td width="10">&nbsp;</td>
		</tr>
          <tr>
            <td align="right">Name </td>
            <td>&nbsp;</td>
            <td><input name="name" type="text" id="name" style="width:100%" value="<%=rc.getString("name")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Report Term</td>
            <td>&nbsp;</td>
            <td><textarea name="report_term"  rows="4" id="report_term" class="style2" style="width:100%"><%=rc.getString("report_term")%></textarea></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Active</td>
            <td>&nbsp;</td>
            <td><input name="active_" id="active_" type="checkbox" value="1" onClick="cbxClick(this)"></td>
            <td>&nbsp;</td>
          </tr>
</table>
<script language="javascript">
function setFieldFocus(value)
{
	setValue("name",value);
	setFocus("name");
}
</script>
<%}%>
<%if (task.getMasterTable().equals("contact_person_master")) {%>
	<table width="100%" border="0" align="center" class="style2">
		<tr>
		  <td align="right">Table</td>
		  <td>&nbsp;</td>
		  <td align="" class="style1">CONTACT_PERSON_MASTER</td>
		  <td>&nbsp;</td>
	  </tr>
		<tr>
			<td width="98" align="right">ID</td>
			<td width="10">&nbsp;</td>
			<td class="style1"><label id="id"><%=rc.getInt("id")%></label></td>
			<td width="10">&nbsp;</td>
		</tr>
          <tr>
            <td align="right">Name </td>
            <td>&nbsp;</td>
            <td><input name="name" type="text" id="name" style="width:100%" value="<%=rc.getString("name")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Title</td>
            <td>&nbsp;</td>
            <td><input name="title" type="text" id="title" style="width:100%" value="<%=rc.getString("title")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">E-Mail</td>
            <td>&nbsp;</td>
            <td><input name="email" type="text" id="email" style="width:100%" value="<%=rc.getString("email")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Telephone</td>
            <td>&nbsp;</td>
            <td><input name="telephone" type="text" id="telephone" style="width:100%" value="<%=rc.getString("telephone")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Fax</td>
            <td>&nbsp;</td>
            <td><input name="fax" type="text" id="fax" style="width:100%" value="<%=rc.getString("fax")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Hand Phone</td>
            <td>&nbsp;</td>
            <td><input name="hand_phone" type="text" id="hand_phone" style="width:100%" value="<%=rc.getString("hand_phone")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Company</td>
            <td>&nbsp;</td>
            <td>
			<select name="company_id" id="company_id" style="width:100%">
				<%
					task.getResponse().setOption(task.getMasterList("company_master"));
					task.getResponse().setSelected("company_id",rc.getIntValue("company_id"));
				%>
            </select>
			</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Active</td>
            <td>&nbsp;</td>
            <td><input name="active_" id="active_" type="checkbox" value="1" onClick="cbxClick(this)"></td>
            <td>&nbsp;</td>
          </tr>
</table>
<%}%>
<%if (task.getMasterTable().equals("contract_term_master")) {%>
	<table width="100%" border="0" class="style2">
		<tr>
		  <td align="right">Table</td>
		  <td>&nbsp;</td>
		  <td align="" class="style1">CONTRACT_TERM_MASTER</td>
		  <td>&nbsp;</td>
	  </tr>
		<tr>
			<td width="98" align="right">ID</td>
			<td width="10">&nbsp;</td>
		  <td class="style1"><label id="id"><%=rc.getInt("id")%></label></td>
			<td width="10">&nbsp;</td>
		</tr>
          <tr>
            <td align="right">Name </td>
            <td>&nbsp;</td>
            <td><input name="name" type="text" id="name" class="style2" style="width:100%" value="<%=rc.getString("name")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Weights</td>
            <td>&nbsp;</td>
            <td><input name="weights" type="text" id="weights" style="width:100%" value="<%=rc.getString("weights")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Report Term</td>
            <td>&nbsp;</td>
            <td><input name="report_term" id="report_term"  type="text" class="style2" style="width:100%;" value="<%=rc.getString("report_term")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Remarks</td>
            <td>&nbsp;</td>
            <td><textarea name="remarks"  rows="10" id="remarks"  class="style2" style="width:100%"><%=rc.getString("remarks")%></textarea></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Active</td>
            <td>&nbsp;</td>
            <td><input name="active_" type="checkbox" id="active_" onClick="cbxClick(this);" value="1"></td>
            <td>&nbsp;</td>
          </tr>
</table>
<%}%>
<%if (task.getMasterTable().equals("region_master")) {%>
	<table width="100%" border="0" class="style2">
		<tr>
		  <td align="right">Table</td>
		  <td>&nbsp;</td>
		  <td align="" class="style1">REGION_MASTER</td>
		  <td>&nbsp;</td>
	  </tr>
		<tr>
			<td width="98" align="right">ID</td>
			<td width="10">&nbsp;</td>
		  <td class="style1"><label id="id"><%=rc.getInt("id")%></label></td>
			<td width="10">&nbsp;</td>
		</tr>
          <tr>
            <td align="right">Name </td>
            <td>&nbsp;</td>
            <td><input name="name" type="text" id="name" style="width:100%" value="<%=rc.getString("name")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Active</td>
            <td>&nbsp;</td>
            <td><input name="active_" id="active_" type="checkbox" value="1" onClick="cbxClick(this)"></td>
            <td>&nbsp;</td>
          </tr>
</table>
<script language="javascript">
function setFieldFocus(value)
{
	setValue("name",value);
	setFocus("name");
}
</script>
<%}%>
<%if (task.getMasterTable().equals("country_master")) {%>
	<table width="100%" border="0" class="style2">
		<tr>
		  <td align="right">Table</td>
		  <td>&nbsp;</td>
		  <td align="" class="style1">COUNTRY_MASTER</td>
		  <td>&nbsp;</td>
	  </tr>
		<tr>
			<td width="98" align="right">ID</td>
			<td width="10">&nbsp;</td>
			<td class="style1"><label id="id"><%=rc.getInt("id")%></label></td>
			<td width="10">&nbsp;</td>
		</tr>
          <tr>
            <td align="right">Country Code</td>
            <td>&nbsp;</td>
            <td><input name="country_code" type="text" class="style1" id="country_code" style="width:60" value="<%=rc.getString("country_code")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Name </td>
            <td>&nbsp;</td>
            <td><input name="name" type="text" id="name" style="width:100%" value="<%=rc.getString("name")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Region</td>
            <td>&nbsp;</td>
            <td>
			<select name="region_id" id="region_id"  style="width:100%">
			<%
				task.getResponse().setOption(task.getMasterList("region_master",true));
				task.getResponse().setSelected("region_id",rc.getIntValue("region_id"));
			%>
            </select>			
			</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Active</td>
            <td>&nbsp;</td>
            <td><input name="active_" type="checkbox" id="active_" onClick="cbxClick(this)" value="1"></td>
            <td>&nbsp;</td>
          </tr>
</table>
<script language="javascript">
function setFieldFocus(value)
{
	setValue("country_code","NEW");
	setFocus("country_code");
}
</script>
<%}%>
<%if (task.getMasterTable().equals("city_master")) {%>
	<table width="100%" border="0" class="style2">
		<tr>
		  <td align="right">Table</td>
		  <td>&nbsp;</td>
		  <td align="" class="style1">DESTINATION_MASTER</td>
		  <td>&nbsp;</td>
	  </tr>
		<tr>
			<td width="98" align="right">ID</td>
			<td width="10">&nbsp;</td>
		  <td class="style1"><label id="id"><%=rc.getInt("id")%></label></td>
			<td width="10">&nbsp;</td>
		</tr>
          <tr>
            <td align="right">Country</td>
            <td>&nbsp;</td>
            <td>
              <select name="country_code" id="country_code"  style="width:100%">
                <%
			  		ResultSet cm1= task.getSQLCommand().executeQuery("SELECT country_code as id, name FROM country_master order by name");
					task.getResponse().setOption(cm1);
					task.getResponse().setSelected("country_code",rc.getString("country_code"));
				%>
              </select>
</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Name </td>
            <td>&nbsp;</td>
            <td><input name="name" type="text" id="name" style="width:100%" value="<%=rc.getString("name")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Active</td>
            <td>&nbsp;</td>
            <td><input name="active_" id="active_" type="checkbox" value="1" onClick="cbxClick(this)"></td>
            <td>&nbsp;</td>
          </tr>
</table>
<script language="javascript">
function setFieldFocus(value)
{
	setValue("name",value);
	setFocus("name");
}
</script>
<%}%>
<%if (task.getMasterTable().equals("origin_master")) {%>
	<table width="100%" border="0" class="style2">
		<tr>
		  <td align="right">Table</td>
		  <td>&nbsp;</td>
		  <td align="" class="style1">ORIGIN_MASTER</td>
		  <td>&nbsp;</td>
	  </tr>
		<tr>
			<td width="98" align="right">ID</td>
			<td width="10">&nbsp;</td>
		  <td class="style1"><label id="id"><%=rc.getInt("id")%></label></td>
			<td width="10">&nbsp;</td>
		</tr>
          <tr>
            <td align="right">Name </td>
            <td>&nbsp;</td>
            <td><input name="name" type="text" id="name" style="width:100%" value="<%=rc.getString("name")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Active</td>
            <td>&nbsp;</td>
            <td><input name="active_" id="active_" type="checkbox" value="1" onClick="cbxClick(this)"></td>
            <td>&nbsp;</td>
          </tr>
</table>
<script language="javascript">
function setFieldFocus(value)
{
	setValue("name",value);
	setFocus("name");
}
</script>
<%}%>
<%if (task.getMasterTable().equals("quality_master")) {%>
	<table width="100%" border="0" class="style2">
		<tr>
		  <td align="right">Table</td>
		  <td>&nbsp;</td>
		  <td align="" class="style1">QUALITY_MASTER</td>
		  <td>&nbsp;</td>
	  </tr>
		<tr>
			<td width="98" align="right">ID</td>
			<td width="10">&nbsp;</td>
		  <td class="style1"><label id="id"><%=rc.getInt("id")%></label></td>
			<td width="10">&nbsp;</td>
		</tr>
          <tr>
            <td align="right">Name </td>
            <td>&nbsp;</td>
            <td><input name="name" type="text" id="name" style="width:100%" value="<%=rc.getString("name")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Active</td>
            <td>&nbsp;</td>
            <td><input name="active_" id="active_" type="checkbox" value="1" onClick="cbxClick(this)"></td>
            <td>&nbsp;</td>
          </tr>
</table>
<script language="javascript">
function setFieldFocus(value)
{
	setValue("name",value);
	setFocus("name");
}
</script>
<%}%>
<%@ page import="wstrader.task.reference.*" %>
<%if (task.getMasterTable().equals("grade_master")) {%>
	<table width="100%" border="0" class="style2">
      <tr>
        <td align="right">Table</td>
        <td>&nbsp;</td>
        <td align="" class="style1">GRADE_MASTER</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="98" align="right">ID</td>
        <td width="10">&nbsp;</td>
        <td class="style1"><label id="id"><%=rc.getInt("id")%></label></td>
        <td width="10">&nbsp;</td>
      </tr>
      <tr>
        <td align="right">Origin</td>
        <td>&nbsp;</td>
        <td class="style1"><select name="origin_id" id="origin_id"  style="width:100%" onChange="doPost();">
            <%task.getResponse().setOption(task.getMasterList("origin_master"));%>
            <%task.getResponse().setSelected("origin_id",task.getRequest().getIntValue("origin_id",1));%>
        </select></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td align="right">Quality</td>
        <td>&nbsp;</td>
        <td class="style1"><select name="quality_id" id="quality_id"  style="width:100%" onChange="doPost();">
            <%task.getResponse().setOption(task.getMasterList("quality_master"));%>
            <%task.getResponse().setSelected("quality_id", task.getRequest().getIntValue("quality_id",2));%>
        </select></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td align="right">Grade</td>
        <td>&nbsp;</td>
        <td><input name="name" type="text" id="name" class="style2"style="width:100%" value="<%=rc.getString("name")%>"></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td align="right">Description</td>
        <td>&nbsp;</td>
        <td><textarea name="description" id="description"  rows="6" class="style2" style="width:100%"><%=rc.getString("description")%></textarea></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td  align="right">Type</td>
        <td>&nbsp;</td>
        <td>
		<select name="type" id="type">
		<option value="0"> </option>
        <option value="P">Purchase</option>
        <option value="S">Sales</option>
		<option value="O">Output</option>
        <%task.getResponse().setSelected("type",rc.getString("type"));%>		
        </select>
		</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td  align="right">Active</td>
        <td>&nbsp;</td>
        <td><input name="active_" id="active_" type="checkbox" value="1" onClick="cbxClick(this)"></td>
        <td>&nbsp;</td>
      </tr>
    </table>
<script language="javascript">
function setFieldFocus(value)
{
	setValue("name",value);
	setFocus("name");
}
</script>
<%}%>
<%if (task.getMasterTable().equals("grade_description_master")) {%>
	<table width="100%" border="0" class="style2">
		<tr>
		  <td align="right">Table</td>
		  <td>&nbsp;</td>
		  <td align="" class="style1">GRADE_DESCRIPTION_MASTER</td>
		  <td>&nbsp;</td>
	  </tr>
		<tr>
			<td width="98" align="right">ID</td>
			<td width="10">&nbsp;</td>
			<td><label id="id"><%=rc.getInt("id")%></label></td>
			<td width="10">&nbsp;</td>
		</tr>
          <tr>
            <td align="right">Grade</td>
            <td>&nbsp;</td>
            <td><select name="grade_id" id="grade_id"  style="width:100%">
              <%
					task.getResponse().setOption(task.getMasterList("grade_master"));
					task.getResponse().setSelected("country_id",rc.getIntValue("grade_id"));
				%>
            </select></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Name </td>
            <td>&nbsp;</td>
            <td><input name="name" type="text" id="name" style="width:100%" value="<%=rc.getString("name")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Description</td>
            <td>&nbsp;</td>
            <td><textarea name="description"  rows="6" style="width:100%"><%=rc.getString("description")%></textarea></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Active</td>
            <td>&nbsp;</td>
            <td><input name="active_" id="active_" type="checkbox" value="1" onClick="cbxClick(this)"></td>
            <td>&nbsp;</td>
          </tr>
</table>
<script language="javascript">
function setFieldFocus(value)
{
	setValue("name",value);
	setFocus("name");
}
</script>
<%}%>
<%if (task.getMasterTable().equals("packing_master")) {%>
	<table width="100%" border="0" class="style2">
		<tr>
		  <td align="right">Table</td>
		  <td>&nbsp;</td>
		  <td align="" class="style1">PACKING_MASTER</td>
		  <td>&nbsp;</td>
	  </tr>
		<tr>
			<td width="98" align="right">ID</td>
			<td width="10">&nbsp;</td>
		  <td class="style1"><label id="id"><%=rc.getInt("id")%></label></td>
			<td width="10">&nbsp;</td>
		</tr>
          <tr>
            <td align="right">Name </td>
            <td>&nbsp;</td>
            <td><input name="name" type="text" id="name" style="width:100%" value="<%=rc.getString("name")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Weight (Kgs)</td>
            <td>&nbsp;</td>
            <td><input name="weight" type="text" id="weight" style="width:100%" value="<%=rc.getFloat("weight")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Description</td>
            <td>&nbsp;</td>
            <td><textarea name="description"  rows="4" style="width:100%"><%=rc.getString("description")%></textarea></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Active</td>
            <td>&nbsp;</td>
            <td><input name="active_" id="active_" type="checkbox" value="1" onClick="cbxClick(this)"></td>
            <td>&nbsp;</td>
          </tr>
</table>
<script language="javascript">
function setFieldFocus(value)
{
	setValue("name",value);
	setFocus("name");
}
</script>
<%}%>
<%if (task.getMasterTable().equals("payment_term_master")) {%>
	<table width="100%" border="0" class="style2">
		<tr>
		  <td align="right">Table</td>
		  <td>&nbsp;</td>
		  <td align="" class="style1">PAYMENT_TERM_MASTER</td>
		  <td>&nbsp;</td>
	  </tr>
		<tr>
			<td width="98" align="right">ID</td>
			<td width="10">&nbsp;</td>
		  <td class="style1"><label id="id"><%=rc.getInt("id")%></label></td>
			<td width="10">&nbsp;</td>
		</tr>
          <tr>
            <td align="right">Name </td>
            <td>&nbsp;</td>
            <td><input name="name" type="text" id="name" class="style2" style="width:100%" value="<%=rc.getString("name")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Report Term</td>
            <td>&nbsp;</td>
            <td><textarea name="report_term"  rows="4" class="style2" style="width:100%"><%=rc.getString("report_term")%></textarea></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Remarks</td>
            <td>&nbsp;</td>
            <td><textarea name="remarks"  rows="4" id="remarks" class="style2" style="width:100%"><%=rc.getString("remarks")%></textarea></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Active</td>
            <td>&nbsp;</td>
            <td><input name="active_" id="active_" type="checkbox" value="1" onClick="cbxClick(this)"></td>
            <td>&nbsp;</td>
          </tr>
</table>
<script language="javascript">
function setFieldFocus(value)
{
	setValue("name",value);
	setFocus("name");
}
</script>
<%}%>
<%if (task.getMasterTable().equals("quality_process_master")) {%>
	<table width="100%" border="0" class="style2">
		<tr>
		  <td align="right">Table</td>
		  <td>&nbsp;</td>
		  <td align="" class="style1">QUALITY_PROCESS_MASTER</td>
		  <td>&nbsp;</td>
	  </tr>
		<tr>
			<td width="98" align="right">ID</td>
			<td width="10">&nbsp;</td>
		  <td class="style1"><label id="id"><%=rc.getInt("id")%></label></td>
			<td width="10">&nbsp;</td>
		</tr>
          <tr>
            <td align="right">Name </td>
            <td>&nbsp;</td>
            <td><input name="name" type="text" id="name" style="width:100%" value="<%=rc.getString("name")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Active</td>
            <td>&nbsp;</td>
            <td><input name="active_" id="active_" type="checkbox" value="1" onClick="cbxClick(this)"></td>
            <td>&nbsp;</td>
          </tr>
</table>
<script language="javascript">
function setFieldFocus(value)
{
	setValue("name",value);
	setFocus("name");
}
</script>
<%}%>
<%if (task.getMasterTable().equals("port_master")) {%>
<table width="100%" border="0" class="style2">
		<tr>
		  <td align="right">Table</td>
		  <td>&nbsp;</td>
		  <td align="" class="style1">PORT_MASTER</td>
		  <td>&nbsp;</td>
	  </tr>
		<tr>
			<td width="98" align="right">ID</td>
			<td width="10">&nbsp;</td>
		  <td class="style1"><label id="id"><%=rc.getInt("id")%></label></td>
			<td width="10">&nbsp;</td>
		</tr>
          <tr>
            <td align="right">Port Name </td>
            <td>&nbsp;</td>
            <td><input name="name" type="text" id="name" style="width:100%" value="<%=rc.getString("name")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Country</td>
            <td>&nbsp;</td>
            <td><select name="country_code" id="country_code"  style="width:100%">
			<option id="0">&nbsp;</option>
              <%
			  ResultSet cm= task.getSQLCommand().executeQuery("SELECT country_code as id, name FROM country_master");
					task.getResponse().setOption(cm);
					task.getResponse().setSelected("country_code",rc.getString("country_code"));
				%>
            </select></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Active</td>
            <td>&nbsp;</td>
            <td><input name="active_" id="active_" type="checkbox" value="1" onClick="cbxClick(this)"></td>
            <td>&nbsp;</td>
          </tr>
</table>
<%}%>

	<%if (task.getMasterTable().equals("document_master")) {%>
<table width="100%" border="0" class="style2">
		<tr>
		  <td align="right">Table</td>
		  <td>&nbsp;</td>
		  <td align="" class="style1">DOCUMENT_MASTER</td>
		  <td>&nbsp;</td>
	  </tr>
		<tr>
			<td width="98" align="right">ID</td>
			<td width="10">&nbsp;</td>
		  <td class="style1"><label id="id"><%=rc.getInt("id")%></label></td>
			<td width="10">&nbsp;</td>
		</tr>
          <tr>
            <td align="right">Document Name </td>
            <td>&nbsp;</td>
            <td>              <input name="name" type="text" id="name" style="width:100%" value="<%=rc.getString("name")%>"></td><td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Document Type </td>
            <td>&nbsp;</td>
            <td><select name="type" id="type"  style="width:100%">
			<option value = "S">Shipping</option>
			<option value = "D">Delivery</option>	
			<%
				task.getResponse().setSelected("type",rc.getString("type"));
			%>		
            </select></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Active</td>
            <td>&nbsp;</td>
            <td><input name="active_" id="active_" type="checkbox" value="1" onClick="cbxClick(this)"></td>
            <td>&nbsp;</td>
          </tr>
</table>
<%}%>	
<%if (task.getMasterTable().equals("warehouse_master")) {%>
<table width="100%" border="0" class="style2">
		<tr>
		  <td width="12%" align="right">Table</td>
		  <td width="2%" >&nbsp;</td>
		  <td width="85%" class="style1">WAREHOUSE_MASTER</td>
		  <td width="1%">&nbsp;</td>
	  </tr>
		<tr>
			<td align="right">ID</td>
			<td>&nbsp;</td>
		  <td class="style1"><label id="id"><%=rc.getInt("id")%></label></td>
			<td>&nbsp;</td>
		</tr>
          <tr>
            <td align="right">Warehouse Name </td>
            <td>&nbsp;</td>
            <td><input name="name" type="text" id="name" style="width:100%" value="<%=rc.getString("name")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Warehouse Type </td>
            <td>&nbsp;</td>
            <td><select name="type" id="type"  style="width:100%">
			<option id = "BONDED">BONDED</option>
			<option id = "NON-BONDED">NON-BONDED</option>			
            </select></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Address1</td>
            <td>&nbsp;</td>
            <td><input name="address1" type="text" id="address1" style="width:100%" value="<%=rc.getString("address1")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Address2</td>
            <td>&nbsp;</td>
            <td><input name="address2" type="text" id="address2" style="width:100%" value="<%=rc.getString("address2")%>"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">City</td>
            <td>&nbsp;</td>
            <td><select name="city_id" id="city_id"  style="width:100%">
              <%task.getResponse().setOption(task.getMasterList("city_master","name"));%>
			  <%task.getResponse().setSelected("city_id",rc.getIntValue("city_id"));%>
            </select></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Active</td>
            <td>&nbsp;</td>
            <td><input name="active_" id="active_" type="checkbox" value="1" onClick="cbxClick(this)"></td>
            <td>&nbsp;</td>
          </tr>
</table>
<%}%>
<%if (task.getMasterTable().equals("futures_account_master")) {%>	
<table width="100%" border="0" class="style2">
		<tr>
		  <td align="right">Table</td>
		  <td>&nbsp;</td>
		  <td align="" class="style1">FUTURES_ACCOUNT_MASTER</td>
		  <td>&nbsp;</td>
	  </tr>
		<tr>
			<td width="98" align="right">ID</td>
			<td width="10">&nbsp;</td>
		  <td class="style1"><label id="id"><%=rc.getInt("id")%></label></td>
			<td width="10">&nbsp;</td>
		</tr>
          <tr>
            <td align="right">Broker Name </td>
            <td>&nbsp;</td>
            <td><input name="name" type="text" id="name" style="width:100%" value="<%=rc.getString("name")%>" onDblClick="setObjValue(this,'');">            </td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Commission</td>
            <td>&nbsp;</td>
            <td><input name="commission" type="text" id="commission" style="width:100%" value="<%=Utils.numberToStr(rc.getFloatValue("commission"),0,false)%>" onDblClick="setObjValue(this,'');"></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">Active</td>
            <td>&nbsp;</td>
            <td><input name="active_" id="active_" type="checkbox" value="1" onClick="cbxClick(this)"></td>
            <td>&nbsp;</td>
          </tr>
</table>
<%}%>
